package zuoye_3_17;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class Zuoye_fangfayinyong {
	public static void main(String[] args) {
		ArrayList<String> list = new ArrayList<>();
		Collections.addAll(list, "孤儿-18", "天才-20", "高手-22", "呆比-11");
		
		List<Student> list1 = list.stream()
		.map(Student::new)
		.collect(Collectors.toList());
		System.out.println(list1);
		
		List<String> list2 = list.stream()
			    .map(t -> t.split("-")[0])
			    .collect(Collectors.toList());
		System.out.println(list2);

		 List<String> list3 = list1.stream()
		            .map(Student::toString)
		            .collect(Collectors.toList());
		 System.out.println(list3);
	}
}
